package com.leyou.time.controller;

import org.joda.time.DateTime;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/time")
public class TimeController {
    @GetMapping("/nowTime")
    public ResponseEntity<String> getNowTime(){
        String nowTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss");
        return ResponseEntity.ok(nowTime);
    }

}
